import Tkinter as tk
import sys, os

import XmlTkinter

## program entry point
def main(nameOfTool):
    target = nameOfTool
    root   = tk.Tk()

    # assigning application icon
    if os.path.isfile("plugins/%s.ico" % (target)):
        root.wm_iconbitmap("plugins/%s.ico" % (target))

    controller = XmlTkinter.Controller()
    controller.run(root, target)

    # waiting for user input
    root.mainloop()

if __name__ == "__main__":
    try:
        main(sys.argv[1])
    except:
        main("bookmarks1")
